import { AxiosResponse } from 'axios';
import { HttpResult } from '../result';

/**
 * 服务器端异常
 */

export class ServerErrorException extends Error {
  /** 本次请求的axios response */
  public readonly response?: AxiosResponse<HttpResult<unknown>>;
  constructor(message = '服务器异常', response?: AxiosResponse<HttpResult<unknown>>) {
    super(message);
    this.response = response;
    this.name = 'ServerErrorException';
  }
}
